define([], function() {
  return function(host) {
    return {
      baseUrl: '',
      paths: {
        jquery: host + '/assets/lib/jquery/1.9.1/jquery.min',
        jqueryui: 'http://cdn.bootcss.com/jqueryui/1.12.1/jquery-ui.min',
        bootstrap: host + '/assets/lib/bootstrap/js/bootstrap',
        backbone: host + '/assets/lib/backbone/backbone-min',
        underscore: host + '/assets/lib/underscore/underscore-min',
        mockjs: host + '/assets/lib/mockjs/mock-min',
        lodash: host + '/assets/lib/underscore/lodash.min',
        angular: host + '/assets/lib/angular/1.2.18/angular.min',
        vue: host + '/assets/lib/vue/vue.min',
        moment: host + '/assets/lib/moment/moment.min',
        axios: 'https://cdn.bootcdn.net/ajax/libs/axios/0.27.2/axios.min',
        // three83: 'http://cdn.bootcss.com/three.js/r83/three.min',
        three: 'https://cdn.bootcdn.net/ajax/libs/three.js/110/three.min',
        markdown: 'http://cdn.bootcss.com/markdown-it/8.2.2/markdown-it.min',
        highlight: 'http://cdn.bootcss.com/highlight.js/9.9.0/highlight.min',

        AColorPicker: 'https://cdn.jsdelivr.net/npm/a-color-picker@1.2.1/dist/acolorpicker.min',
        select2: 'https://cdn.bootcdn.net/ajax/libs/select2/4.0.9/js/select2.min', //要先加到dom才能初始化

        html2canvas: 'http://html2canvas.hertzen.com/dist/html2canvas.min',

        d3v3: 'https://d3js.org/d3.v3.min',
        d3: 'http://cdn.bootcss.com/d3/4.4.1/d3.min',
        io: 'http://cdn.bootcss.com/socket.io/1.7.2/socket.io.min',
        konva: host + '/assets/lib/konva/konva.min',
        eventemitter3: host + '/assets/lib/eventemitter3/eventemitter3.min',

        "react-old": host + "/assets/lib/react/react-with-addons.min",
        "react-dom-old": host + "/assets/lib/react/react-dom.min",
        "react-redux-old": 'https://cdn.bootcdn.net/ajax/libs/react-redux/5.1.2/react-redux.min',
        
        react16: 'https://cdn.bootcdn.net/ajax/libs/react/16.8.3/umd/react.development.min',
        "react-dom16": 'https://cdn.bootcdn.net/ajax/libs/react-dom/16.8.3/umd/react-dom.development.min',
        
        react: host + "/assets/lib/react/v17/react.development.min",
        'react-dom': host + "/assets/lib/react/v17/react-dom.development.min",
        'react-redux': 'https://cdn.bootcdn.net/ajax/libs/react-redux/7.2.1/react-redux.min',

        redux: 'https://cdn.bootcdn.net/ajax/libs/redux/4.0.5/redux.min',

        //.production.min .development .development.min
        'react-router': 'https://cdn.bootcdn.net/ajax/libs/react-router/6.3.0/react-router.development.min',
        'react-router-dom': 'https://cdn.bootcdn.net/ajax/libs/react-router-dom/6.3.0/react-router-dom.development.min',
        history: 'https://cdn.bootcdn.net/ajax/libs/history/5.3.0/history.development.min',

        // antd: host + '/assets/lib/antd/antd.min',
        antd: 'https://cdn.bootcdn.net/ajax/libs/antd/4.16.9/antd.min',

        refresh: host + '/assets/js/footer-refresh',
        init: host + '/assets/js/init',

        tmp: host + '/t',
        assets: host + '/assets',
        npm: host + '/node_modules',
        hy5b: host + '/hy5b',
        
        t: host + '/hy5b/t/index',
        test: host + '/hy5b/t/test',
        jsonview: host + '/hy5b/frontend/jsonview/index',
        frontend: host + '/hy5b/t/frontend',
        ext: host + '/hy5b/t/ext',

        service: '../basic/app/js/ext/service',
        event: '../basic/app/js/ext/event',

        abc: '../abc',
        data: 'v/graph/data',
        option: 'v/graph/option',
        
        // babel: host + '/assets/lib/require/plugins/requirejs-babel/babel-5.8.34.min', // v5

        // babel: host + '/assets/lib/require/plugins/babel/babel.min', // v6

		    babel: host + '/assets/lib/require/plugins/babel/v7/babel.min', // v7
        "babel-plugin-module-resolver": host + '/assets/lib/require/plugins/babel/v7/babel-plugin-module-resolver-standalone', // v7

        // ethers: host + '/assets/lib/eth/ethers-v4.min',
        ethers: host + '/assets/lib/eth/ethers.umd.min', // v5
      },
      map: {
        '*': {
          css: host + '/assets/lib/require/plugins/css.min.js',
          json: host + '/assets/lib/require/plugins/json.js',
          less: host + '/assets/lib/require/plugins/less/less.js',
          scss: host + '/assets/lib/require/plugins/scss/scss.js',
          text: host + '/assets/lib/require/plugins/text.js',
          html: host + '/assets/lib/require/plugins/text.js',
          // es6: host + '/assets/lib/require/plugins/requirejs-babel/es6.js', //v5
          // jsx: host + "/assets/lib/require/plugins/requirejs-babel/es6.js", //v5
          // es6: host + '/assets/lib/require/plugins/babel/es6.js', //v6
          // jsx: host + "/assets/lib/require/plugins/babel/es6.js", //v6
          es6: host + '/assets/lib/require/plugins/babel/v7/es6.js', //v7
          jsx: host + "/assets/lib/require/plugins/babel/v7/es6.js", //v7
        }
      },
      shim: {
        backbone: ['underscore', 'jquery'],
        jqueryui: ['jquery'],
        bootstrap: ['jquery'],
        angular: {
          deps: [],
          exports: 'angular' // 从全局中获取该变量作为依赖时注入的值，用于未使用 define([])定义的模块
        },
        react: {
          exports: 'React'
        }
      },
      babel: { // for babel/es6
        sourceMaps: false, // One of [false, 'inline', 'both']. See https://babeljs.io/docs/usage/options/
        fileExtension: ".js" // Can be set to anything, like .es6 or .js. Defaults to .jsx
      },
      pluginSuffix: ['jsx', 'ts', 'tsx', 'html', 'json', 'css', 'less', 'scss'], // for require.fock
      config: {
        [host + '/assets/lib/require/plugins/babel/v7/es6.js']: { // for babel/v7/es6
          presets: ["react", ["stage-0", { decoratorsBeforeExport: false }]],
          extraPlugins: [],
          resolveModuleSource: function(sourcePath) {
            if (/\.[jt]sx?$/.test(sourcePath)) {
              console.warn(sourcePath, '->', 'es6!' + sourcePath)
              return 'es6!' + sourcePath;
            } else if (/\.json$/.test(sourcePath)) {
              console.warn(sourcePath, '->', 'json!' + sourcePath)
              return 'json!' + sourcePath;
            }
          },
        }
      }
    };
  }
})
